package com.dykj.fireFighting.common.core.utils;

import java.text.SimpleDateFormat;
import java.util.*;

public class ZcDataCleaning {
    public static  String dataCleaning(String bjzt){
        String result="";
        StringJoiner stringJoiner = new StringJoiner(",");
        if (bjzt.contains("1001")){
            stringJoiner.add("电流A报警");
        }
        if (bjzt.contains("1002")) {
            stringJoiner.add("电流B报警");
        }
        if (bjzt.contains("1003")) {
            stringJoiner.add("电流C报警");
        }
        if (bjzt.contains("1011")) {
            stringJoiner.add("温度A报警");
        }
        if (bjzt.contains("1012")) {
            stringJoiner.add("温度B报警");
        }
        if (bjzt.contains("1013")) {
            stringJoiner.add("温度C报警");
        }
        if (bjzt.contains("1014")) {
            stringJoiner.add("温度N报警");
        }
        if (bjzt.contains("1021")) {
            stringJoiner.add("电压A欠压");
        }
        if (bjzt.contains("1022")) {
            stringJoiner.add("电压A过压");
        }
        if (bjzt.contains("1023")) {
            stringJoiner.add("电压B欠压");
        }
        if (bjzt.contains("1024")) {
            stringJoiner.add("电压B过压");
        }
        if (bjzt.contains("1025")) {
            stringJoiner.add("电压C欠压");
        }
        if (bjzt.contains("1026")) {
            stringJoiner.add("电压C过压");
        }
        if (bjzt.contains("1031")) {
            stringJoiner.add("漏电报警");
        }
        if (bjzt.contains("35")){
            stringJoiner.add("上线");
        }
        if (bjzt.contains("36")){
            stringJoiner.add("下线");
        }
        result = stringJoiner.toString();
        return  result;
    }

    public static void main(String[] args) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Calendar cal = Calendar.getInstance();
        List<Integer> yearList=new ArrayList<>();
        yearList.add(cal.get(Calendar.YEAR));

        cal.setTime(new Date());
        cal.add(Calendar.YEAR, -1);
        yearList.add(cal.get(Calendar.YEAR));

        cal.setTime(new Date());
        cal.add(Calendar.YEAR, -2);
        yearList.add(cal.get(Calendar.YEAR));
        for (int i = 0; i < yearList.size(); i++) {
            System.out.println(yearList.get(i));
        }
    }
}
